﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class add_YWLB : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {

        }
    }
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        if (this.TextBoxLBMC.Text.Trim() != "")
        {
            using (DataClassesDataContext ds = new DataClassesDataContext())
            {
                YeWuZiLiao p = new YeWuZiLiao();
                p.mingcheng = this.TextBoxLBMC.Text.Trim().ToString();
                p.parentID = -1;
                ds.YeWuZiLiao.InsertOnSubmit(p);
                ds.SubmitChanges();
            }
                Response.Write("<script>alert('添加成功！')</script>");
        }
        else
        {
            Response.Write("<script>alert('类别名称不能为空！')</script>");
        }
    }
}